<!DOCTYPE html>
<html class="writer-html5" lang="en">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>CommonUtils &mdash; MetronomeStatic 0.1.0 documentation</title>
      <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
      <link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../_static/jquery.js?v=5d32c60e"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js?v=2389946f"></script>
        <script src="../_static/doctools.js?v=888ff710"></script>
        <script src="../_static/sphinx_highlight.js?v=4825356b"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="ClangUtils" href="clang_utils.html" />
    <link rel="prev" title="MelodieGenerator" href="melodie_generator.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../index.html" class="icon icon-home">
            MetronomeStatic
              <img src="../_static/sky-cloud.png" class="logo" alt="Logo"/>
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation.html#user-installation">User Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation.html#developer-installation">Developer Installation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/_index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/clang_utils.html">Clang Utils</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../tutorial/clang_utils.html#loading-source-code-printing-ast">Loading Source Code &amp; Printing AST</a></li>
<li class="toctree-l3"><a class="reference internal" href="../tutorial/clang_utils.html#querying-the-ast-interactively">Querying The AST Interactively</a></li>
<li class="toctree-l3"><a class="reference internal" href="../tutorial/clang_utils.html#querying-code-attributes">Querying Code Attributes</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../tutorial/clang_utils.html#queries-for-variables">Queries for Variables</a></li>
<li class="toctree-l4"><a class="reference internal" href="../tutorial/clang_utils.html#parsing-expressions">Parsing Expressions</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/universal_ast.html">Universal AST (UAST)</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="_index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="melodie_generator.html">MelodieGenerator</a><ul>
<li class="toctree-l3"><a class="reference internal" href="melodie_generator.html#members-list">Members List</a><ul>
<li class="toctree-l4"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieFrozenGenerator"><code class="docutils literal notranslate"><span class="pre">MelodieFrozenGenerator</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator"><code class="docutils literal notranslate"><span class="pre">MelodieGenerator</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">CommonUtils</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#tips-before-reading">Tips Before Reading</a></li>
<li class="toctree-l3"><a class="reference internal" href="#members-list">Members List</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#MetronomeStatic.utils.MelodieFrozenGenerator"><code class="docutils literal notranslate"><span class="pre">MelodieFrozenGenerator</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#MetronomeStatic.utils.MelodieGenerator"><code class="docutils literal notranslate"><span class="pre">MelodieGenerator</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#MetronomeStatic.utils.abspath_from_current_file"><code class="docutils literal notranslate"><span class="pre">abspath_from_current_file()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#MetronomeStatic.utils.compose"><code class="docutils literal notranslate"><span class="pre">compose()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#MetronomeStatic.utils.file_to_dataurl"><code class="docutils literal notranslate"><span class="pre">file_to_dataurl()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#MetronomeStatic.utils.parse_dataurl"><code class="docutils literal notranslate"><span class="pre">parse_dataurl()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="clang_utils.html">ClangUtils</a><ul>
<li class="toctree-l3"><a class="reference internal" href="clang_utils.html#tips-before-reading">Tips Before Reading</a></li>
<li class="toctree-l3"><a class="reference internal" href="clang_utils.html#members-list">Members List</a><ul>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.ClassDefModel"><code class="docutils literal notranslate"><span class="pre">ClassDefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.DefModel"><code class="docutils literal notranslate"><span class="pre">DefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.FieldDefModel"><code class="docutils literal notranslate"><span class="pre">FieldDefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.FunctionDefModel"><code class="docutils literal notranslate"><span class="pre">FunctionDefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.ParamDefModel"><code class="docutils literal notranslate"><span class="pre">ParamDefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.StructDefModel"><code class="docutils literal notranslate"><span class="pre">StructDefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.TraversalContext"><code class="docutils literal notranslate"><span class="pre">TraversalContext</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.TypeDefModel"><code class="docutils literal notranslate"><span class="pre">TypeDefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.TypeWrapper"><code class="docutils literal notranslate"><span class="pre">TypeWrapper</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.UnaryOpPos"><code class="docutils literal notranslate"><span class="pre">UnaryOpPos</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.UnionDefModel"><code class="docutils literal notranslate"><span class="pre">UnionDefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.VarDefModel"><code class="docutils literal notranslate"><span class="pre">VarDefModel</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.all_globals"><code class="docutils literal notranslate"><span class="pre">all_globals()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.beautified_print_ast"><code class="docutils literal notranslate"><span class="pre">beautified_print_ast()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.build_call_graph"><code class="docutils literal notranslate"><span class="pre">build_call_graph()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.extract_ast"><code class="docutils literal notranslate"><span class="pre">extract_ast()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.get_compound_assignment_operator"><code class="docutils literal notranslate"><span class="pre">get_compound_assignment_operator()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.get_func_decl"><code class="docutils literal notranslate"><span class="pre">get_func_decl()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.get_func_decl_all"><code class="docutils literal notranslate"><span class="pre">get_func_decl_all()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.get_global_ref_names"><code class="docutils literal notranslate"><span class="pre">get_global_ref_names()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.get_global_refs"><code class="docutils literal notranslate"><span class="pre">get_global_refs()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.get_local_var_defs"><code class="docutils literal notranslate"><span class="pre">get_local_var_defs()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.get_param_decls"><code class="docutils literal notranslate"><span class="pre">get_param_decls()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.get_var_refs"><code class="docutils literal notranslate"><span class="pre">get_var_refs()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.is_function_definition"><code class="docutils literal notranslate"><span class="pre">is_function_definition()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.iter_ast"><code class="docutils literal notranslate"><span class="pre">iter_ast()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.iter_ast_from_file"><code class="docutils literal notranslate"><span class="pre">iter_ast_from_file()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.iter_files"><code class="docutils literal notranslate"><span class="pre">iter_files()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.parse_file"><code class="docutils literal notranslate"><span class="pre">parse_file()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.program_model_unparse"><code class="docutils literal notranslate"><span class="pre">program_model_unparse()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.split_binary_operator"><code class="docutils literal notranslate"><span class="pre">split_binary_operator()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.split_compound_assignment"><code class="docutils literal notranslate"><span class="pre">split_compound_assignment()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.split_for_loop_conditions"><code class="docutils literal notranslate"><span class="pre">split_for_loop_conditions()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.split_unary_operator"><code class="docutils literal notranslate"><span class="pre">split_unary_operator()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.traversal"><code class="docutils literal notranslate"><span class="pre">traversal()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="clang_utils.html#MetronomeStatic.clang_utils.code_attributes.traversal_with_callback"><code class="docutils literal notranslate"><span class="pre">traversal_with_callback()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="universal_ast.html">Universal AST</a><ul>
<li class="toctree-l3"><a class="reference internal" href="universal_ast.html#members-list">Members List</a><ul>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Additive"><code class="docutils literal notranslate"><span class="pre">Additive</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.And"><code class="docutils literal notranslate"><span class="pre">And</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Annotation"><code class="docutils literal notranslate"><span class="pre">Annotation</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.AnnotationDeclaration"><code class="docutils literal notranslate"><span class="pre">AnnotationDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.AnnotationMember"><code class="docutils literal notranslate"><span class="pre">AnnotationMember</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.AnnotationMethodDeclaration"><code class="docutils literal notranslate"><span class="pre">AnnotationMethodDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ArrayAccess"><code class="docutils literal notranslate"><span class="pre">ArrayAccess</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ArrayCreation"><code class="docutils literal notranslate"><span class="pre">ArrayCreation</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ArrayInitializer"><code class="docutils literal notranslate"><span class="pre">ArrayInitializer</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Assert"><code class="docutils literal notranslate"><span class="pre">Assert</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Assignment"><code class="docutils literal notranslate"><span class="pre">Assignment</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.BinaryExpression"><code class="docutils literal notranslate"><span class="pre">BinaryExpression</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Block"><code class="docutils literal notranslate"><span class="pre">Block</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Break"><code class="docutils literal notranslate"><span class="pre">Break</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Cast"><code class="docutils literal notranslate"><span class="pre">Cast</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Catch"><code class="docutils literal notranslate"><span class="pre">Catch</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ClassDeclaration"><code class="docutils literal notranslate"><span class="pre">ClassDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ClassInitializer"><code class="docutils literal notranslate"><span class="pre">ClassInitializer</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ClassLiteral"><code class="docutils literal notranslate"><span class="pre">ClassLiteral</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.CompilationUnit"><code class="docutils literal notranslate"><span class="pre">CompilationUnit</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Conditional"><code class="docutils literal notranslate"><span class="pre">Conditional</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ConditionalAnd"><code class="docutils literal notranslate"><span class="pre">ConditionalAnd</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ConditionalOr"><code class="docutils literal notranslate"><span class="pre">ConditionalOr</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ConstructorDeclaration"><code class="docutils literal notranslate"><span class="pre">ConstructorDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ConstructorInvocation"><code class="docutils literal notranslate"><span class="pre">ConstructorInvocation</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Continue"><code class="docutils literal notranslate"><span class="pre">Continue</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.DefaultStatement"><code class="docutils literal notranslate"><span class="pre">DefaultStatement</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.DereferenceExpr"><code class="docutils literal notranslate"><span class="pre">DereferenceExpr</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.DoWhile"><code class="docutils literal notranslate"><span class="pre">DoWhile</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Empty"><code class="docutils literal notranslate"><span class="pre">Empty</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.EmptyDeclaration"><code class="docutils literal notranslate"><span class="pre">EmptyDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.EnumConstant"><code class="docutils literal notranslate"><span class="pre">EnumConstant</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.EnumDeclaration"><code class="docutils literal notranslate"><span class="pre">EnumDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Equality"><code class="docutils literal notranslate"><span class="pre">Equality</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Expression"><code class="docutils literal notranslate"><span class="pre">Expression</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ExpressionStatement"><code class="docutils literal notranslate"><span class="pre">ExpressionStatement</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.FieldAccess"><code class="docutils literal notranslate"><span class="pre">FieldAccess</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.FieldDeclaration"><code class="docutils literal notranslate"><span class="pre">FieldDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.For"><code class="docutils literal notranslate"><span class="pre">For</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ForEach"><code class="docutils literal notranslate"><span class="pre">ForEach</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.FormalParameter"><code class="docutils literal notranslate"><span class="pre">FormalParameter</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.FuncCall"><code class="docutils literal notranslate"><span class="pre">FuncCall</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.GoToStatement"><code class="docutils literal notranslate"><span class="pre">GoToStatement</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.IfThenElse"><code class="docutils literal notranslate"><span class="pre">IfThenElse</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ImportDeclaration"><code class="docutils literal notranslate"><span class="pre">ImportDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.InstanceCreation"><code class="docutils literal notranslate"><span class="pre">InstanceCreation</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.InstanceOf"><code class="docutils literal notranslate"><span class="pre">InstanceOf</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.InterfaceDeclaration"><code class="docutils literal notranslate"><span class="pre">InterfaceDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Label"><code class="docutils literal notranslate"><span class="pre">Label</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Literal"><code class="docutils literal notranslate"><span class="pre">Literal</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.MethodDeclaration"><code class="docutils literal notranslate"><span class="pre">MethodDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Multiplicative"><code class="docutils literal notranslate"><span class="pre">Multiplicative</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Name"><code class="docutils literal notranslate"><span class="pre">Name</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Or"><code class="docutils literal notranslate"><span class="pre">Or</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.PackageDeclaration"><code class="docutils literal notranslate"><span class="pre">PackageDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.ReferenceExpr"><code class="docutils literal notranslate"><span class="pre">ReferenceExpr</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Relational"><code class="docutils literal notranslate"><span class="pre">Relational</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Resource"><code class="docutils literal notranslate"><span class="pre">Resource</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Return"><code class="docutils literal notranslate"><span class="pre">Return</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Shift"><code class="docutils literal notranslate"><span class="pre">Shift</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.SourceElement"><code class="docutils literal notranslate"><span class="pre">SourceElement</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Statement"><code class="docutils literal notranslate"><span class="pre">Statement</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Switch"><code class="docutils literal notranslate"><span class="pre">Switch</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.SwitchCase"><code class="docutils literal notranslate"><span class="pre">SwitchCase</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Synchronized"><code class="docutils literal notranslate"><span class="pre">Synchronized</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Throw"><code class="docutils literal notranslate"><span class="pre">Throw</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Throws"><code class="docutils literal notranslate"><span class="pre">Throws</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Try"><code class="docutils literal notranslate"><span class="pre">Try</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Type"><code class="docutils literal notranslate"><span class="pre">Type</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.TypeParameter"><code class="docutils literal notranslate"><span class="pre">TypeParameter</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Unary"><code class="docutils literal notranslate"><span class="pre">Unary</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Variable"><code class="docutils literal notranslate"><span class="pre">Variable</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.VariableDeclaration"><code class="docutils literal notranslate"><span class="pre">VariableDeclaration</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.VariableDeclarator"><code class="docutils literal notranslate"><span class="pre">VariableDeclarator</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.While"><code class="docutils literal notranslate"><span class="pre">While</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Wildcard"><code class="docutils literal notranslate"><span class="pre">Wildcard</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.WildcardBound"><code class="docutils literal notranslate"><span class="pre">WildcardBound</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="universal_ast.html#MetronomeStatic.universal_ast.universal_ast_nodes.Xor"><code class="docutils literal notranslate"><span class="pre">Xor</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Change Log</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#start-may-10-2023">Start (May. 10, 2023)</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../contribution.html">Contribution</a></li>
<li class="toctree-l1"><a class="reference internal" href="../about.html">About</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">MetronomeStatic</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="_index.html">API Reference</a></li>
      <li class="breadcrumb-item active">CommonUtils</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/api/common_utils.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="commonutils">
<h1>CommonUtils<a class="headerlink" href="#commonutils" title="Permalink to this heading"></a></h1>
<section id="tips-before-reading">
<h2>Tips Before Reading<a class="headerlink" href="#tips-before-reading" title="Permalink to this heading"></a></h2>
<ul class="simple">
<li><p>Functions or Classes in this page should be imported by:</p></li>
</ul>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">MetronomeStatic</span> <span class="kn">import</span> <span class="o">&lt;</span><span class="s2">&quot;Members Listed In This Page&quot;</span><span class="o">&gt;</span>
</pre></div>
</div>
</section>
<section id="members-list">
<h2>Members List<a class="headerlink" href="#members-list" title="Permalink to this heading"></a></h2>
<span class="target" id="module-MetronomeStatic.utils"><span id="apidoc-commonutils"></span></span><dl class="py class">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieFrozenGenerator">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">MelodieFrozenGenerator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inner</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#MetronomeStatic.utils.MelodieFrozenGenerator" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><code class="xref py py-class docutils literal notranslate"><span class="pre">MelodieGenerator</span></code></a>[<code class="xref py py-obj docutils literal notranslate"><span class="pre">VARTYPE</span></code>]</p>
<p><code class="docutils literal notranslate"><span class="pre">MelodieFrozenGenerator</span></code> is like <code class="docutils literal notranslate"><span class="pre">MelodieGenerator</span></code>, but it will start from the same
head object when applying <code class="docutils literal notranslate"><span class="pre">iter(g)</span></code> on it for multiple times.</p>
<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieFrozenGenerator.__init__">
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inner</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#MetronomeStatic.utils.MelodieFrozenGenerator.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieFrozenGenerator.head">
<span class="sig-name descname"><span class="pre">head</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Any</span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieFrozenGenerator.head" title="Permalink to this definition"></a></dt>
<dd><p>Get the first element of this generator</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieFrozenGenerator.relsort">
<span class="sig-name descname"><span class="pre">relsort</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmp</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">bool</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reverse</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieFrozenGenerator" title="MelodieFuncFlow.functional.MelodieFrozenGenerator"><span class="pre">MelodieFrozenGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieFrozenGenerator.relsort" title="Permalink to this definition"></a></dt>
<dd><p>Sort by relative comparisons</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieFrozenGenerator.show_progress">
<span class="sig-name descname"><span class="pre">show_progress</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieFrozenGenerator.show_progress" title="Permalink to this definition"></a></dt>
<dd><p>Show the progress of this iterator, without interfering the computation flow.</p>
<p>For frozen generator, this will show a tqdm progress bar with percentage.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieFrozenGenerator.sort">
<span class="sig-name descname"><span class="pre">sort</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">float</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">tuple</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reverse</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieFrozenGenerator" title="MelodieFuncFlow.functional.MelodieFrozenGenerator"><span class="pre">MelodieFrozenGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieFrozenGenerator.sort" title="Permalink to this definition"></a></dt>
<dd><p>Sort by key</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">MelodieGenerator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inner</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Generator</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">None</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">None</span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">Iterable</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Generic</span></code>[<code class="xref py py-obj docutils literal notranslate"><span class="pre">VARTYPE</span></code>]</p>
<p>A generator supporting some common functional-programming operations</p>
<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.__init__">
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inner</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Generator</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">None</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">None</span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">Iterable</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.attributes">
<span class="sig-name descname"><span class="pre">attributes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.attributes" title="Permalink to this definition"></a></dt>
<dd><p>Get attribute from each elements, returning a new generator containing
attribute values.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.cast">
<span class="sig-name descname"><span class="pre">cast</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">t_</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Type</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.cast" title="Permalink to this definition"></a></dt>
<dd><p>Cast returning type for each element of this iterator.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.exhaust">
<span class="sig-name descname"><span class="pre">exhaust</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.exhaust" title="Permalink to this definition"></a></dt>
<dd><p>Go through this generator until it is exhausted, returning <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.extra_job">
<span class="sig-name descname"><span class="pre">extra_job</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.extra_job" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>Inserting function call <code class="docutils literal notranslate"><span class="pre">func(elem)</span></code> in the middle of the calculation process of a functional</dt><dd><p>program, which does not affect the calculation process.</p>
</dd>
<dt>For example, the result of <code class="docutils literal notranslate"><span class="pre">g.execute(print).map(lambda</span> <span class="pre">item:</span> <span class="pre">item.value)</span></code></dt><dd><p>is the same as <code class="docutils literal notranslate"><span class="pre">g.map(lambda</span> <span class="pre">item:</span> <span class="pre">item.value)</span></code>,
but the former has extra printouts for each element.</p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.f">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">f</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieFrozenGenerator" title="MelodieFuncFlow.functional.MelodieFrozenGenerator"><span class="pre">MelodieFrozenGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.f" title="Permalink to this definition"></a></dt>
<dd><p>Shortcut property for <code class="docutils literal notranslate"><span class="pre">freeze()</span></code> method</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.filter">
<span class="sig-name descname"><span class="pre">filter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">condition</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">bool</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.filter" title="Permalink to this definition"></a></dt>
<dd><p>Filter elements that function <code class="docutils literal notranslate"><span class="pre">condition</span></code> returns <code class="docutils literal notranslate"><span class="pre">True</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.fold_left">
<span class="sig-name descname"><span class="pre">fold_left</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">VARTYPE2</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.fold_left" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">fold_left</span></code> is a higher-order function in functional programming</dt><dd><p>languages that performs a binary operation on elements of a list
or sequence, accumulating the result from left to right.</p>
</dd>
</dl>
<p>This method takes two arguments:</p>
<dl class="field-list simple">
<dt class="field-odd">Initial<span class="colon">:</span></dt>
<dd class="field-odd"><p>An initial value (often called the “identity” or “zero element”)</p>
</dd>
<dt class="field-even">Func<span class="colon">:</span></dt>
<dd class="field-even"><p>A binary operation (also known as a “reducer” or “combinator”)</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.freeze">
<span class="sig-name descname"><span class="pre">freeze</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieFrozenGenerator" title="MelodieFuncFlow.functional.MelodieFrozenGenerator"><span class="pre">MelodieFrozenGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.freeze" title="Permalink to this definition"></a></dt>
<dd><p>Convert the current iterator to a <code class="docutils literal notranslate"><span class="pre">MelodieFrozenGenerator</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.head">
<span class="sig-name descname"><span class="pre">head</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">VARTYPE</span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.head" title="Permalink to this definition"></a></dt>
<dd><p>Get the first element of this generator</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.indexed_extra_job">
<span class="sig-name descname"><span class="pre">indexed_extra_job</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.indexed_extra_job" title="Permalink to this definition"></a></dt>
<dd><p>Like <code class="docutils literal notranslate"><span class="pre">extra_job</span></code>, but with index.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.indexed_filter">
<span class="sig-name descname"><span class="pre">indexed_filter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">condition</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">bool</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.indexed_filter" title="Permalink to this definition"></a></dt>
<dd><p>Filter elements that function <code class="docutils literal notranslate"><span class="pre">condition</span></code> returns <code class="docutils literal notranslate"><span class="pre">True</span></code> with index</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.indexed_map">
<span class="sig-name descname"><span class="pre">indexed_map</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.indexed_map" title="Permalink to this definition"></a></dt>
<dd><p>Map function <code class="docutils literal notranslate"><span class="pre">func</span></code> to each element</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.l">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">l</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.l" title="Permalink to this definition"></a></dt>
<dd><p>Shortcut property for <code class="docutils literal notranslate"><span class="pre">to_list()</span></code> method</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.map">
<span class="sig-name descname"><span class="pre">map</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.map" title="Permalink to this definition"></a></dt>
<dd><p>Map function <code class="docutils literal notranslate"><span class="pre">func</span></code> to each element</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.parallel_map">
<span class="sig-name descname"><span class="pre">parallel_map</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">star</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">init_code</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.parallel_map" title="Permalink to this definition"></a></dt>
<dd><p>Map with <code class="docutils literal notranslate"><span class="pre">ipyparallel</span></code>.</p>
<p>Members in this package will be automatically imported.</p>
<p>To use members from other packages, please inject the initialization
code by <code class="docutils literal notranslate"><span class="pre">init_code</span></code> parameter.</p>
<dl class="field-list simple">
<dt class="field-odd">Init_code<span class="colon">:</span></dt>
<dd class="field-odd"><p>Code to be executed <code class="docutils literal notranslate"><span class="pre">before</span></code> parallel execution.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.reduce">
<span class="sig-name descname"><span class="pre">reduce</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">VARTYPE</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">VARTYPE</span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.reduce" title="Permalink to this definition"></a></dt>
<dd><p>Perform reduce on this generator.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.s">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">s</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">Set</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.s" title="Permalink to this definition"></a></dt>
<dd><p>Shortcut property for <code class="docutils literal notranslate"><span class="pre">to_set()</span></code> method</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.show_progress">
<span class="sig-name descname"><span class="pre">show_progress</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.show_progress" title="Permalink to this definition"></a></dt>
<dd><p>Show the progress of this iterator, without interfering the computation flow.</p>
<p>For <code class="docutils literal notranslate"><span class="pre">MelodieGenerator</span></code>, as the total number is not determined, a counter-only
tqdm progress indicator will be shown like <code class="docutils literal notranslate"><span class="pre">20it</span> <span class="pre">[00:02,</span>&#160; <span class="pre">9.01it/s]</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.slice">
<span class="sig-name descname"><span class="pre">slice</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bound</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rbound</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.slice" title="Permalink to this definition"></a></dt>
<dd><p>Select an interval of elements inside this generator, returning a new Generator.</p>
<dl class="simple">
<dt>If two arguments passed in and rbound&gt;=0,</dt><dd><p>the interval is close-left and open-right: <code class="docutils literal notranslate"><span class="pre">[bound,</span> <span class="pre">rbound)</span></code></p>
</dd>
<dt>If two arguments passed in and rbound==-1,</dt><dd><p>the interval is: <code class="docutils literal notranslate"><span class="pre">[bound,</span> <span class="pre">+∞)</span></code>.
<strong>Other rbound&lt;-1 values were not supported.</strong></p>
</dd>
</dl>
<p>If one argument passed in, like <cite>range</cite>, the interval is <code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">bound)</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.star_filter">
<span class="sig-name descname"><span class="pre">star_filter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">condition</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">bool</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.star_filter" title="Permalink to this definition"></a></dt>
<dd><p>Filter elements that function <code class="docutils literal notranslate"><span class="pre">condition</span></code> returns <code class="docutils literal notranslate"><span class="pre">True</span></code>.
Each element will be unpacked by <code class="docutils literal notranslate"><span class="pre">*elem</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.star_map">
<span class="sig-name descname"><span class="pre">star_map</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="melodie_generator.html#MelodieFuncFlow.functional.MelodieGenerator" title="MelodieFuncFlow.functional.MelodieGenerator"><span class="pre">MelodieGenerator</span></a><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE2</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.star_map" title="Permalink to this definition"></a></dt>
<dd><p>Map function <code class="docutils literal notranslate"><span class="pre">func</span></code> to each element with unpacking them by <code class="docutils literal notranslate"><span class="pre">*elem</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.to_list">
<span class="sig-name descname"><span class="pre">to_list</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.to_list" title="Permalink to this definition"></a></dt>
<dd><p>Convert this generator to list</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="MetronomeStatic.utils.MelodieGenerator.to_set">
<span class="sig-name descname"><span class="pre">to_set</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Set</span><span class="p"><span class="pre">[</span></span><span class="pre">VARTYPE</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.MelodieGenerator.to_set" title="Permalink to this definition"></a></dt>
<dd><p>Convert this generator to set</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="MetronomeStatic.utils.abspath_from_current_file">
<span class="sig-name descname"><span class="pre">abspath_from_current_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rel_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">current_file</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="headerlink" href="#MetronomeStatic.utils.abspath_from_current_file" title="Permalink to this definition"></a></dt>
<dd><p>Convert the relative path to absolute path.</p>
<p>TODO: Deprecated method</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="MetronomeStatic.utils.compose">
<span class="sig-name descname"><span class="pre">compose</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f_outer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">T</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">other_funcs</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">T</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#MetronomeStatic.utils.compose" title="Permalink to this definition"></a></dt>
<dd><p>Compose functions (from right to left)</p>
<p>When function returns a tuple, the tuple will be automatically unpacked.
To avoid this, just return a list.</p>
<dl class="field-list simple">
<dt class="field-odd">Type<span class="colon">:</span></dt>
<dd class="field-odd"><p>Just a type annotation for the return-type of composed function.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="MetronomeStatic.utils.file_to_dataurl">
<span class="sig-name descname"><span class="pre">file_to_dataurl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#MetronomeStatic.utils.file_to_dataurl" title="Permalink to this definition"></a></dt>
<dd><p>将文件转为dataurl</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="MetronomeStatic.utils.parse_dataurl">
<span class="sig-name descname"><span class="pre">parse_dataurl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dataurl</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#MetronomeStatic.utils.parse_dataurl" title="Permalink to this definition"></a></dt>
<dd><p>解析前端传来的dataurl</p>
</dd></dl>

</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="melodie_generator.html" class="btn btn-neutral float-left" title="MelodieGenerator" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="clang_utils.html" class="btn btn-neutral float-right" title="ClangUtils" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2022-2023, SkyGroup.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>